/*
 * Selling Partner API for Product Type Definitions
 *
 * The Selling Partner API for Product Type Definitions provides programmatic access to attribute and data requirements for product types in the Amazon catalog. Use this API to return the JSON Schema for a product type that you can then use with other Selling Partner APIs, such as the Selling Partner API for Listings Items, the Selling Partner API for Catalog Items, and the Selling Partner API for Feeds (for JSON-based listing feeds).  For more information, see the [Product Type Definitions API Use Case Guide](doc:product-type-api-use-case-guide).
 *
 * The version of the OpenAPI document: 2020-09-01
 * Generated by: https://github.com/openapitools/openapi-generator.git
 */


using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.IO;
using System.Runtime.Serialization;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System.ComponentModel.DataAnnotations;
using OpenAPIDateConverter = software.amzn.spapi.Client.OpenAPIDateConverter;

namespace software.amzn.spapi.Model.productTypeDefinitions.v2020_09_01
{
    /// <summary>
    /// A product type definition represents the attributes and data requirements for a product type in the Amazon catalog. Product type definitions are used interchangeably between the Selling Partner API for Listings Items, Selling Partner API for Catalog Items, and JSON-based listings feeds in the Selling Partner API for Feeds.
    /// </summary>
    [DataContract(Name = "ProductTypeDefinition")]
    public partial class ProductTypeDefinition : IValidatableObject
    {
        /// <summary>
        /// Name of the requirements set represented in this product type definition.
        /// </summary>
        /// <value>Name of the requirements set represented in this product type definition.</value>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum RequirementsEnum
        {
            /// <summary>
            /// Enum LISTING for value: LISTING
            /// </summary>
            [EnumMember(Value = "LISTING")]
            LISTING = 1,

            /// <summary>
            /// Enum LISTINGPRODUCTONLY for value: LISTING_PRODUCT_ONLY
            /// </summary>
            [EnumMember(Value = "LISTING_PRODUCT_ONLY")]
            LISTINGPRODUCTONLY = 2,

            /// <summary>
            /// Enum LISTINGOFFERONLY for value: LISTING_OFFER_ONLY
            /// </summary>
            [EnumMember(Value = "LISTING_OFFER_ONLY")]
            LISTINGOFFERONLY = 3
        }


        /// <summary>
        /// Name of the requirements set represented in this product type definition.
        /// </summary>
        /// <value>Name of the requirements set represented in this product type definition.</value>
        [DataMember(Name = "requirements", IsRequired = true, EmitDefaultValue = true)]
        public RequirementsEnum Requirements { get; set; }
        /// <summary>
        /// Identifies if the required attributes for a requirements set are enforced by the product type definition schema. Non-enforced requirements enable structural validation of individual attributes without all of the required attributes being present (such as for partial updates).
        /// </summary>
        /// <value>Identifies if the required attributes for a requirements set are enforced by the product type definition schema. Non-enforced requirements enable structural validation of individual attributes without all of the required attributes being present (such as for partial updates).</value>
        [JsonConverter(typeof(StringEnumConverter))]
        public enum RequirementsEnforcedEnum
        {
            /// <summary>
            /// Enum ENFORCED for value: ENFORCED
            /// </summary>
            [EnumMember(Value = "ENFORCED")]
            ENFORCED = 1,

            /// <summary>
            /// Enum NOTENFORCED for value: NOT_ENFORCED
            /// </summary>
            [EnumMember(Value = "NOT_ENFORCED")]
            NOTENFORCED = 2
        }


        /// <summary>
        /// Identifies if the required attributes for a requirements set are enforced by the product type definition schema. Non-enforced requirements enable structural validation of individual attributes without all of the required attributes being present (such as for partial updates).
        /// </summary>
        /// <value>Identifies if the required attributes for a requirements set are enforced by the product type definition schema. Non-enforced requirements enable structural validation of individual attributes without all of the required attributes being present (such as for partial updates).</value>
        [DataMember(Name = "requirementsEnforced", IsRequired = true, EmitDefaultValue = true)]
        public RequirementsEnforcedEnum RequirementsEnforced { get; set; }
        /// <summary>
        /// Initializes a new instance of the <see cref="ProductTypeDefinition" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected ProductTypeDefinition() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="ProductTypeDefinition" /> class.
        /// </summary>
        /// <param name="metaSchema">metaSchema.</param>
        /// <param name="schema">schema (required).</param>
        /// <param name="requirements">Name of the requirements set represented in this product type definition. (required).</param>
        /// <param name="requirementsEnforced">Identifies if the required attributes for a requirements set are enforced by the product type definition schema. Non-enforced requirements enable structural validation of individual attributes without all of the required attributes being present (such as for partial updates). (required).</param>
        /// <param name="propertyGroups">Mapping of property group names to property groups. Property groups represent logical groupings of schema properties that can be used for display or informational purposes. (required).</param>
        /// <param name="locale">Locale of the display elements contained in the product type definition. (required).</param>
        /// <param name="marketplaceIds">Amazon marketplace identifiers for which the product type definition is applicable. (required).</param>
        /// <param name="productType">The name of the Amazon product type that this product type definition applies to. (required).</param>
        /// <param name="displayName">Human-readable and localized description of the Amazon product type. (required).</param>
        /// <param name="productTypeVersion">productTypeVersion (required).</param>
        public ProductTypeDefinition(SchemaLink metaSchema = default(SchemaLink), SchemaLink schema = default(SchemaLink), RequirementsEnum requirements = default(RequirementsEnum), RequirementsEnforcedEnum requirementsEnforced = default(RequirementsEnforcedEnum), Dictionary<string, PropertyGroup> propertyGroups = default(Dictionary<string, PropertyGroup>), string locale = default(string), List<string> marketplaceIds = default(List<string>), string productType = default(string), string displayName = default(string), ProductTypeVersion productTypeVersion = default(ProductTypeVersion))
        {
            // to ensure "schema" is required (not null)
            if (schema == null)
            {
                throw new ArgumentNullException("schema is a required property for ProductTypeDefinition and cannot be null");
            }
            this.Schema = schema;
            this.Requirements = requirements;
            this.RequirementsEnforced = requirementsEnforced;
            // to ensure "propertyGroups" is required (not null)
            if (propertyGroups == null)
            {
                throw new ArgumentNullException("propertyGroups is a required property for ProductTypeDefinition and cannot be null");
            }
            this.PropertyGroups = propertyGroups;
            // to ensure "locale" is required (not null)
            if (locale == null)
            {
                throw new ArgumentNullException("locale is a required property for ProductTypeDefinition and cannot be null");
            }
            this.Locale = locale;
            // to ensure "marketplaceIds" is required (not null)
            if (marketplaceIds == null)
            {
                throw new ArgumentNullException("marketplaceIds is a required property for ProductTypeDefinition and cannot be null");
            }
            this.MarketplaceIds = marketplaceIds;
            // to ensure "productType" is required (not null)
            if (productType == null)
            {
                throw new ArgumentNullException("productType is a required property for ProductTypeDefinition and cannot be null");
            }
            this.ProductType = productType;
            // to ensure "displayName" is required (not null)
            if (displayName == null)
            {
                throw new ArgumentNullException("displayName is a required property for ProductTypeDefinition and cannot be null");
            }
            this.DisplayName = displayName;
            // to ensure "productTypeVersion" is required (not null)
            if (productTypeVersion == null)
            {
                throw new ArgumentNullException("productTypeVersion is a required property for ProductTypeDefinition and cannot be null");
            }
            this.ProductTypeVersion = productTypeVersion;
            this.MetaSchema = metaSchema;
        }

        /// <summary>
        /// Gets or Sets MetaSchema
        /// </summary>
        [DataMember(Name = "metaSchema", EmitDefaultValue = false)]
        public SchemaLink MetaSchema { get; set; }

        /// <summary>
        /// Gets or Sets Schema
        /// </summary>
        [DataMember(Name = "schema", IsRequired = true, EmitDefaultValue = true)]
        public SchemaLink Schema { get; set; }

        /// <summary>
        /// Mapping of property group names to property groups. Property groups represent logical groupings of schema properties that can be used for display or informational purposes.
        /// </summary>
        /// <value>Mapping of property group names to property groups. Property groups represent logical groupings of schema properties that can be used for display or informational purposes.</value>
        [DataMember(Name = "propertyGroups", IsRequired = true, EmitDefaultValue = true)]
        public Dictionary<string, PropertyGroup> PropertyGroups { get; set; }

        /// <summary>
        /// Locale of the display elements contained in the product type definition.
        /// </summary>
        /// <value>Locale of the display elements contained in the product type definition.</value>
        [DataMember(Name = "locale", IsRequired = true, EmitDefaultValue = true)]
        public string Locale { get; set; }

        /// <summary>
        /// Amazon marketplace identifiers for which the product type definition is applicable.
        /// </summary>
        /// <value>Amazon marketplace identifiers for which the product type definition is applicable.</value>
        [DataMember(Name = "marketplaceIds", IsRequired = true, EmitDefaultValue = true)]
        public List<string> MarketplaceIds { get; set; }

        /// <summary>
        /// The name of the Amazon product type that this product type definition applies to.
        /// </summary>
        /// <value>The name of the Amazon product type that this product type definition applies to.</value>
        [DataMember(Name = "productType", IsRequired = true, EmitDefaultValue = true)]
        public string ProductType { get; set; }

        /// <summary>
        /// Human-readable and localized description of the Amazon product type.
        /// </summary>
        /// <value>Human-readable and localized description of the Amazon product type.</value>
        [DataMember(Name = "displayName", IsRequired = true, EmitDefaultValue = true)]
        public string DisplayName { get; set; }

        /// <summary>
        /// Gets or Sets ProductTypeVersion
        /// </summary>
        [DataMember(Name = "productTypeVersion", IsRequired = true, EmitDefaultValue = true)]
        public ProductTypeVersion ProductTypeVersion { get; set; }

        /// <summary>
        /// Returns the string presentation of the object
        /// </summary>
        /// <returns>String presentation of the object</returns>
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("class ProductTypeDefinition {\n");
            sb.Append("  MetaSchema: ").Append(MetaSchema).Append("\n");
            sb.Append("  Schema: ").Append(Schema).Append("\n");
            sb.Append("  Requirements: ").Append(Requirements).Append("\n");
            sb.Append("  RequirementsEnforced: ").Append(RequirementsEnforced).Append("\n");
            sb.Append("  PropertyGroups: ").Append(PropertyGroups).Append("\n");
            sb.Append("  Locale: ").Append(Locale).Append("\n");
            sb.Append("  MarketplaceIds: ").Append(MarketplaceIds).Append("\n");
            sb.Append("  ProductType: ").Append(ProductType).Append("\n");
            sb.Append("  DisplayName: ").Append(DisplayName).Append("\n");
            sb.Append("  ProductTypeVersion: ").Append(ProductTypeVersion).Append("\n");
            sb.Append("}\n");
            return sb.ToString();
        }

        /// <summary>
        /// Returns the JSON string presentation of the object
        /// </summary>
        /// <returns>JSON string presentation of the object</returns>
        public virtual string ToJson()
        {
            return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
        }

        /// <summary>
        /// To validate all properties of the instance
        /// </summary>
        /// <param name="validationContext">Validation context</param>
        /// <returns>Validation Result</returns>
        IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
        {
            yield break;
        }
    }

}
